const models = require(__base + '/models');
const errcode = require(__util + "/errcode")
const ct = require(__util + "/catch"); // 路由错误捕获(不使用则不会捕获异常错误)

module.exports = ct(async (req, res) => {
  const data = await models.Eosendpoint.findAll({
    where: {
      status: "using"
    },
    order: [["successTotal", "desc"]],
    attributes: ['endpoint']
  })

  return res.json(
    errcode.SUCCESS(data)
  );
})